package net.zjitc.Student;

/**
 * @Author admin
 * @Date 2019/3/20 11:15
 *
 *  本科生
 */
public class Undergraduate extends Student {
    Undergraduate(){

    }

    public  Undergraduate(String name){
        super(name);
        this.type="本科生";
    }
    @Override
    public  void calculateGrade(){
        double total=0;
        double average=0;
        for (int i=0;i<courses.length;i++){
            total+=courses[i];
        }
        average=total/courseNo;
        if (average>=90&&average<=100){
            this.courseGrade="优秀";
        }else if (average>=80){
            this.courseGrade="良好";
        }else if (average>=70){
            this.courseGrade="中等";
        }else if (average>=60){
            this.courseGrade="及格";
        }
    }
}
